<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
	<head>
		<meta charset="utf-8">
		<title>等待考试开始</title>
		<script language='javascript' th:inline="javascript">
			var time=[[${leftms}]];
			console.log(time);
			setTimeout("document.form1.submit()",time)  
		</script>  
		<link href="css/app.css" rel="stylesheet">
		<link rel="stylesheet" href=""/>
		<link rel="stylesheet" href="../../static/css/exam/waitingexam.css"/>
	</head>
	<body>
		<div class="wrapper">
			<nav id="sidebar" class="sidebar js-sidebar">
				<div class="sidebar-content js-simplebar">
					<a class="sidebar-brand" >
		      <span class="align-middle">考试系统</span>
		    </a>
		
					<ul class="sidebar-nav">
						<li class="sidebar-header">
							等待考试开始中
						</li>
						<li class="sidebar-item">
							<a class="sidebar-link" >
								<i class="align-middle" data-feather="activity"></i> <span class="align-middle">平心</span>
						</a>
						</li>
						<li class="sidebar-item">
									<a class="sidebar-link">
						  <i class="align-middle" data-feather="slack"></i> <span class="align-middle">静气</span>
						</a>
								</li>
						
								<li class="sidebar-item">
									<a class="sidebar-link" >
						  <i class="align-middle" data-feather="heart"></i> <span class="align-middle">好运</span>
						</a>
								</li>
						<div class="sidebar-cta">
							<div class="sidebar-cta-content">
								<strong class="d-inline-block mb-2">请耐心等候</strong>
								<div class="mb-3 text-sm">
									在等待考试开始过程中，您不可以跳转到其他页面
								</div>
								<div class="d-grid">
									<a  class="btn btn-primary">Be easy</a>
								</div>
							</div>
						</div>
					</ul>
				</div>
			</nav>
		
			<div class="main">
				<nav class="navbar navbar-expand navbar-light navbar-bg">
					<a class="sidebar-toggle js-sidebar-toggle">
						<i class="hamburger align-self-center"></i>
					</a>
		
					<div class="navbar-collapse collapse">
						<ul class="navbar-nav navbar-align">
							<li class="nav-item dropdown">
								<a class="nav-icon dropdown-toggle d-inline-block d-sm-none" href="#" data-bs-toggle="dropdown">
									<i class="align-middle" data-feather="settings"></i>
								</a>
		
								<a class="nav-link dropdown-toggle d-none d-sm-inline-block" href="#" data-bs-toggle="dropdown">
									<i class="align-middle me-2" data-feather="feather"></i>
									<span th:if="${usertype} eq '0'">老师</span>
									<span th:if="${usertype} eq '1'">学生</span>
									<span th:if="${usertype} eq '2'">管理员</span>
									<img src="img/avatars/avatar.jpg" class="avatar img-fluid rounded me-1" alt="Charles Hall" /> 
									<span class="text-dark" th:text="${usermail}"></span>
								</a>
								
							</li>
						</ul>
					</div>
				</nav>
				<!--倒数-->
				<script type="text/javascript" th:inline="javascript">
					function getRTime(){
					var StrEndTime= [[${starttime}]]; //考试开始时间
					var EndTime= new Date(StrEndTime);
					console.log(EndTime);
					var NowTime = new Date(); 
					var t =EndTime.getTime() - NowTime.getTime(); 
					if (t<0){setTimeout("document.form1.submit()",0); }
					var d=Math.floor(t/1000/60/60/24); 
					var h=Math.floor(t/1000/60/60%24); 
					var m=Math.floor(t/1000/60%60); 
					var s=Math.floor(t/1000%60); 
					document.getElementById("t_m").innerHTML = "0" + m ; 
					if (s<10){
						document.getElementById("t_s").innerHTML = "0"+s ; 
						}
					else{
						document.getElementById("t_s").innerHTML = s ; 
						}
					} 
					setInterval(getRTime,1000); 
				</script> 
				<!--在这里写我自己的东西-->
				<main class="content">
					<div class="container-fluid p-0">
					<form action="/DoingExam1" enctype='multipart/form-data' method='POST' name='form1'>
						<button type="submit" class="btn btn-default" style="display:none">试一试</button> 
					</form>
						<h1 class="h3 mb-3">签到成功！</h1>
				
						<div class="row">
							<div class="col-12">
								<div class="card">
									<div class="card-body">
										<div class="timetitle">
											<span style="font-size:30px">距离考试开始还剩：</span>
										</div>
										<div class="timecount">
											<div class="forno"></div>
											<div class="forno">
												<span style="font-size:120px" id="t_m">00</span>
											</div>
											<div class="forno">
												<span style="font-size:120px">分</span>
											</div>
											<div class="forno">
												<span style="font-size:120px"  id="t_s">00</span>
											</div>
											<div class="forno">
												<span style="font-size:120px">秒</span>
											</div>
											<div class="forno"></div>
										</div>
										<div class="forecast">
											<div class="sub"></div>
											<div class="sub">
												<div class="formin">
													<div class="subsub"></div>
													<div class="subsub">
														<span style="font-size:20px">
															考试时间总长：
														</span>
													</div>
													<div class="subsub">
														<span style="font-size:20px" th:text="${min}">
															123
														</span>
														<p style='margin-left: 7px;'>
															<span style="font-size:20px">
																分钟
															</span>
														</p>
													</div>
													<div class="subsub"></div>
												</div>
												<div class='forqshow' th:if="${not #lists.isEmpty(upcqlist)}">
													<div class="forqtitle">
														<span style="font-size:20px">
															选择题:
														</span>
													</div>
													<div class="forq">
														<div th:each="i:${upcqlist}" class="eachq">
															<button type="submit" style="width: 30px; height: 30px; border-radius: 50%;border: none;background-color: #7f7fbe;">
																<input type="hidden" name="qtype" value=2><br/>
																<h4 style="margin-top:-15px">
																	<font color="white">
																		<p th:text="${iStat.count}" style="margin-top:-10px">1</p>
																	</font>
																</h4>
															</button>
														</div>
													</div>
													<div class="forqtitle"></div>
												</div>	
												<div class='forqshow' th:if="${not #lists.isEmpty(upjqlist)}">
													<div class="forqtitle">
														<span style="font-size:20px">
															判断题:
														</span>
													</div>
													<div class="forq">
														<div th:each="i:${upjqlist}" class="eachq">
															<button type="submit" style="width: 30px; height: 30px; border-radius: 50%;border: none;background-color: #007a00;">
																<input type="hidden" name="qtype" value=2><br/>
																<h4 style="margin-top:-15px">
																	<font color="white">
																		<p th:text="${iStat.count}" style="margin-top:-10px">1</p>
																	</font>
																</h4>
															</button>
														</div>
													</div>
													<div class="forqtitle"></div>
												</div>	
												<div class='forqshow' th:if="${not #lists.isEmpty(upfqlist)}">
													<div class="forqtitle">
														<span style="font-size:20px">
															填空题:
														</span>
													</div>
													<div class="forq">
														<div th:each="i:${upfqlist}" class="eachq">
															<button type="submit" style="width: 30px; height: 30px; border-radius: 50%;border: none;background-color: #0000aa;">
																<input type="hidden" name="qtype" value=2><br/>
																<h4 style="margin-top:-15px">
																	<font color="white">
																		<p th:text="${iStat.count}" style="margin-top:-10px">1</p>
																	</font>
																</h4>
															</button>
														</div>
													</div>
													<div class="forqtitle"></div>
												</div>	
												<div class='forqshow' th:if="${not #lists.isEmpty(upbqlist)}">
													<div class="forqtitle">
														<span style="font-size:20px">
															简答题:
														</span>
													</div>
													<div class="forq">
														<div th:each="i:${upbqlist}" class="eachq">
															<button type="submit" style="width: 30px; height: 30px; border-radius: 50%;border: none;background-color: #aa557f;">
																<input type="hidden" name="qtype" value=2><br/>
																<h4 style="margin-top:-15px">
																	<font color="white">
																		<p th:text="${iStat.count}" style="margin-top:-10px">1</p>
																	</font>
																</h4>
															</button>
														</div>
													</div>
													<div class="forqtitle"></div>
												</div>	
											</div>
											<div class="sub"></div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</main>
				
				
				
			</div>
		</div>
		
		<script src="js/app.js"></script>
	</body>
</html>
